package cn.wolfcode.car.enumpkg;

import lombok.Getter;
import lombok.Setter;

@Getter
public enum AppointmentStatusEnum {

    PEND("待确认", 0),
    PERFORM("履行中", 1),
    CONSUME("消费中", 2),
    FINISH("归档", 3),
    FAILURE("废弃", 4);

    private String name;
    private Integer status;

    AppointmentStatusEnum(String name, Integer status) {
        this.name = name;
        this.status = status;
    }

    public static String findName(Integer status) {
        AppointmentStatusEnum[] values = AppointmentStatusEnum.values();
        for (AppointmentStatusEnum value : values) {
            if (value.status == status) {
                return value.name;
            }
        }
        return null;
    }

}
